﻿using OA.Core.Model;
using OA.Model.MyAttribute;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OA.Model
{
    public class GeneralField
    {
        /// <summary>
        /// 属性名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 属性
        /// </summary>
        public string Attribute { get; set; }

        /// <summary>
        /// 是否显示
        /// </summary>
        [Tag(TagEnum.Switch, "", "显示", "显示")]
        public bool IsView { get; set; } = true;
    }

    public class ExtendField
    {
        /// <summary>
        /// 用户起草时候是否可以显示并输入
        /// </summary>
        [Tag(TagEnum.Switch,"","","")]
        public bool IsDraftShow { get; set; }


        /// <summary>
        /// 汇总列
        /// </summary>
        [Tag(TagEnum.Switch, "", "", "")]
        public bool IsSummarizing { get; set; }


        public string ParentName { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 属性
        /// </summary>
        public string Attribute { get; set; }

        /// <summary>
        /// 属性类型
        /// </summary>
        [Tag(TagEnum.Select, typeof(TagEnum), "", true)]
        public int Type { get; set; }

        /// <summary>
        /// 最小长度/最小值 引用的CustomID
        /// </summary>
        public int Min { get; set; }

        /// <summary>
        /// 最大长度/最大值 引用的FormID
        /// </summary>
        public int Max { get; set; }

        /// <summary>
        /// 提示信息
        /// </summary>
        public string Tips { get; set; }

        ///// <summary>
        ///// 验证规则
        ///// </summary>
        //public string Verify { get; set; }

        /// <summary>
        /// 是否必填
        /// </summary>
        public bool IsRequired { get; set; }

        /// <summary>
        /// 默认值  表格结果
        /// </summary>
        public string DefaultValue { get; set; }

        /// <summary>
        /// Select 数据源
        /// </summary>
        public string Values { get; set; }

        /// <summary>
        /// -1 不可见  0 正常 1 可以编辑
        /// </summary>
        public int Status { get; set; } = 1;

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 原值
        /// </summary>
        public string Value { get; set; }       

        /// <summary>
        /// 显示的内容
        /// </summary>
        public string Text { get; set; }

        public List<ListItem> DbScore { get; set; }

        /// <summary>
        /// 第三方数据源
        /// </summary>
        public string ThirdPartyDataSource { get; set; }

        /// <summary>
        /// 上传的图片或者部门路径
        /// </summary>
        public List<string> Files { get; set; }

        /// <summary>
        /// 多单据引用
        /// </summary>
        public List<SimpleApproval> Refs { get; set; }

    }
}
